<template>
  <div class="business-register-page">
    <!-- 背景装饰元素 -->
    <div class="bg-decorations">
      <!-- 网络连接线条 -->
      <div class="network-lines">
        <div class="line line-1"></div>
        <div class="line line-2"></div>
        <div class="line line-3"></div>
        <div class="line line-4"></div>
        <div class="line line-5"></div>
      </div>
      
      <!-- 浮动的教育图标 -->
      <div class="floating-icons">
        <div class="icon icon-1">📚</div>
        <div class="icon icon-2">💻</div>
        <div class="icon icon-3">🎓</div>
        <div class="icon icon-4">📊</div>
        <div class="icon icon-5">🌐</div>
        <div class="icon icon-6">💡</div>
      </div>
      
      <!-- 几何图案 -->
      <div class="geometric-shapes">
        <div class="shape shape-1"></div>
        <div class="shape shape-2"></div>
        <div class="shape shape-3"></div>
      </div>
    </div>

    <!-- 重置密码对话框 -->
    <el-dialog 
      v-model="showResetDialog" 
      title="重置登录密码" 
      width="480px" 
      :close-on-click-modal="false"
      class="business-dialog"
    >
      <el-form ref="resetFormRef" :model="resetForm" :rules="resetRules" label-width="0">
        <el-form-item prop="phone">
          <el-input v-model="resetForm.phone" placeholder="请输入手机号" maxlength="11" size="large" />
        </el-form-item>
        <el-form-item prop="verifyCode">
          <div class="verify-code-input">
            <el-input v-model="resetForm.verifyCode" placeholder="请输入验证码" maxlength="6" size="large" />
            <el-button 
              type="primary" 
              size="large"
              :disabled="resetCountdown > 0"
              @click="sendResetSmsCode"
              class="verify-btn"
            >
              {{ resetCountdown > 0 ? `${resetCountdown}s后重新获取` : '获取验证码' }}
            </el-button>
          </div>
        </el-form-item>
        <el-form-item prop="newPassword">
          <el-input v-model="resetForm.newPassword" type="password" placeholder="请输入新密码" size="large" />
        </el-form-item>
        <el-form-item prop="confirmPassword">
          <el-input v-model="resetForm.confirmPassword" type="password" placeholder="请再次输入新密码" size="large" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="showResetDialog = false" size="large">取消</el-button>
          <el-button type="primary" @click="handleResetPassword" size="large">确认重置</el-button>
        </div>
      </template>
    </el-dialog>

    <!-- 主要内容 -->
    <div class="main-container">
      <!-- 左侧品牌区域 -->
      <div class="brand-section">
        <div class="brand-content">
          <div class="brand-logo">
            <div class="logo-icon">
              <svg viewBox="0 0 100 100" fill="none">
                <circle cx="50" cy="50" r="45" stroke="url(#gradient1)" stroke-width="3" fill="none"/>
                <circle cx="50" cy="50" r="35" stroke="url(#gradient2)" stroke-width="2" fill="none"/>
                <path d="M30 40 L50 30 L70 40 L70 60 L50 70 L30 60 Z" fill="url(#gradient3)" opacity="0.8"/>
                <circle cx="50" cy="50" r="8" fill="white"/>
                <defs>
                  <linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="100%">
                    <stop offset="0%" style="stop-color:#4A90E2"/>
                    <stop offset="100%" style="stop-color:#7BB3F0"/>
                  </linearGradient>
                  <linearGradient id="gradient2" x1="0%" y1="0%" x2="100%" y2="100%">
                    <stop offset="0%" style="stop-color:#5BA0F2"/>
                    <stop offset="100%" style="stop-color:#8CC8FF"/>
                  </linearGradient>
                  <linearGradient id="gradient3" x1="0%" y1="0%" x2="100%" y2="100%">
                    <stop offset="0%" style="stop-color:#4A90E2"/>
                    <stop offset="100%" style="stop-color:#6BB0FF"/>
                  </linearGradient>
                </defs>
              </svg>
            </div>
            <div class="logo-text">
              <h1>EduLiveLink</h1>
              <p>智能直播互动教育平台</p>
            </div>
          </div>
          
          <div class="brand-features">
            <div class="feature-item">
              <div class="feature-icon">🎯</div>
              <div class="feature-text">
                <h3>智能教学</h3>
                <p>AI驱动的个性化学习体验</p>
              </div>
            </div>
            <div class="feature-item">
              <div class="feature-icon">🌐</div>
              <div class="feature-text">
                <h3>实时互动</h3>
                <p>多人在线协作学习环境</p>
              </div>
            </div>
            <div class="feature-item">
              <div class="feature-icon">📊</div>
              <div class="feature-text">
                <h3>数据分析</h3>
                <p>学习进度可视化管理</p>
              </div>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 右侧注册区域 -->
      <div class="register-section">
        <div class="register-card-wrapper">
          <div class="register-card-header">
            <h2>创建您的教育账户</h2>
            <p>加入智能直播互动教育平台，开启学习新时代</p>
          </div>
          
          <div class="register-card">
            <!-- 注册表单 -->
            <div class="register-form">
              <div class="form-scroll-container">
                <el-form ref="registerFormRef" :model="registerForm" :rules="registerRules" label-width="0">
                  <!-- 账号输入框 -->
                  <div class="input-group">
                    <label class="input-label">账号</label>
                    <el-input
                      v-model="registerForm.username"
                      placeholder="请输入您的账号"
                      :prefix-icon="User"
                      size="large"
                      class="business-input"
                    />
                  </div>
                  
                  <!-- 密码输入框 -->
                  <div class="input-group">
                    <label class="input-label">密码</label>
                    <el-input
                      v-model="registerForm.password"
                      :type="showPassword ? 'text' : 'password'"
                      placeholder="请输入您的密码"
                      :prefix-icon="Lock"
                      :suffix-icon="showPassword ? View : Hide"
                      @click:suffix="togglePassword"
                      size="large"
                      class="business-input"
                    />
                  </div>
                  
                  <!-- 确认密码输入框 -->
                  <div class="input-group">
                    <label class="input-label">确认密码</label>
                    <el-input
                      v-model="registerForm.confirmPassword"
                      :type="showConfirmPassword ? 'text' : 'password'"
                      placeholder="请再次输入密码"
                      :prefix-icon="Lock"
                      :suffix-icon="showConfirmPassword ? View : Hide"
                      @click:suffix="toggleConfirmPassword"
                      size="large"
                      class="business-input"
                    />
                  </div>
                </el-form>
              </div>
              
              <!-- 固定在底部的按钮和链接 -->
              <div class="form-footer">
                <!-- 登录和忘记密码链接 -->
                <div class="helper-links">
                  <el-link class="helper-link" @click="goToLogin">
                    <span>已有账户？立即登录</span>
                  </el-link>
                  <el-link class="helper-link" @click="showResetDialog = true">
                    <span>忘记密码？</span>
                  </el-link>
                </div>
                
                <!-- 注册按钮 -->
                <el-button
                  type="primary"
                  size="large"
                  class="business-register-btn"
                  @click="handleRegister"
                >
                  <span>立即注册</span>
                  <div class="btn-arrow">→</div>
                </el-button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { User, Lock, View, Hide } from '@element-plus/icons-vue';
import { ElMessage } from 'element-plus';
import { authAPI } from '../../api/auth.js';


const router = useRouter();

const showPassword = ref(false);
const showConfirmPassword = ref(false);
const showResetDialog = ref(false);
const resetCountdown = ref(0);
const registerFormRef = ref();
const resetFormRef = ref();

const registerForm = ref({
  username: '',
  password: '',
  confirmPassword: '',
  role: 2, // 默认为用户角色(2)
});

const resetForm = ref({
  phone: '',
  verifyCode: '',
  newPassword: '',
  confirmPassword: ''
});

const validateConfirmPassword = (rule, value, callback) => {
  if (value === '') {
    callback(new Error('请再次输入密码'));
  } else if (value !== registerForm.value.password) {
    callback(new Error('两次输入密码不一致'));
  } else {
    callback();
  }
};

const validateResetConfirmPassword = (rule, value, callback) => {
  if (value === '') {
    callback(new Error('请再次输入密码'));
  } else if (value !== resetForm.value.newPassword) {
    callback(new Error('两次输入密码不一致'));
  } else {
    callback();
  }
};

const registerRules = ref({
  username: [
    { required: true, message: '请输入账号', trigger: 'blur' },
    { min: 4, max: 20, message: '长度在 4 到 20 个字符', trigger: 'blur' }
  ],
  password: [
    { required: true, message: '请输入密码', trigger: 'blur' },
    { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
  ],
  confirmPassword: [
    { required: true, trigger: 'blur', validator: validateConfirmPassword }
  ]
});

const resetRules = ref({
  phone: [
    { required: true, message: '请输入手机号', trigger: 'blur' },
    { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
  ],
  verifyCode: [
    { required: true, message: '请输入验证码', trigger: 'blur' },
    { len: 6, message: '验证码长度为6位', trigger: 'blur' }
  ],
  newPassword: [
    { required: true, message: '请输入新密码', trigger: 'blur' },
    { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
  ],
  confirmPassword: [
    { required: true, trigger: 'blur', validator: validateResetConfirmPassword }
  ]
});

const startResetCountdown = () => {
  resetCountdown.value = 60;
  const timer = setInterval(() => {
    resetCountdown.value--;
    if (resetCountdown.value <= 0) {
      clearInterval(timer);
    }
  }, 1000);
};



const sendResetSmsCode = () => {
  if (!validatePhone(resetForm.value.phone)) {
    ElMessage.error('请输入正确的手机号');
    return;
  }
  // 调用发送验证码API
  authAPI.sendVerificationCode(resetForm.value.phone)
    .then(() => {
      // 开始倒计时
      startResetCountdown();
      ElMessage.success('验证码已发送，请注意查收');
    })
    .catch(error => {
      ElMessage.error('发送验证码失败：' + (error.message || '未知错误'));
    })
};

const handleRegister = async () => {
  if (!registerFormRef.value) return;
  
  await registerFormRef.value.validate((valid, fields) => {
    if (valid) {
      // 构建注册数据
      const registerData = {
        username: registerForm.value.username,
        password: registerForm.value.password,
        role: parseInt(registerForm.value.role) || 1
      };
      
      // 调用注册API
      authAPI.register(registerData)
        .then(response => {
          if (response.code === 200 && response.data) {
            
            ElMessage.success('注册成功，请登录');
            
            // 注册成功后跳转到登录页面
            router.push('/login');
          } else {
            ElMessage.error(response.message || '注册失败');
          }
        })
        .catch(error => {
          // 错误处理在API拦截器中已经处理
          console.error('注册失败:', error);
        })
    } else {
      console.log('注册表单验证失败:', fields);
    }
  });
};

const handleResetPassword = async () => {
  if (!resetFormRef.value) return;
  
  await resetFormRef.value.validate((valid, fields) => {
    if (valid) {
      // 调用重置密码API
      authAPI.resetPassword(resetForm.value)
        .then(response => {
          if (response.code === 200) {
            ElMessage.success('密码重置成功，请使用新密码登录')
            showResetDialog.value = false
          } else {
            ElMessage.error(response.message || '密码重置失败')
          }
        })
        .catch(error => {
          console.error('重置密码失败:', error)
        })
    } else {
      console.log('reset password error:', fields);
    }
  });
};

const togglePassword = () => {
  showPassword.value = !showPassword.value;
};

const toggleConfirmPassword = () => {
  showConfirmPassword.value = !showConfirmPassword.value;
};

const goToLogin = () => {
  router.push('/login');
};


</script>

<style scoped>
/* 主页面样式 */
.business-register-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #4a90e2 50%, #6bb6ff 75%, #87ceeb 100%);
  position: relative;
  overflow: hidden;
}

/* 背景装饰元素 */
.bg-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

/* 网络连接线条 */
.network-lines {
  position: absolute;
  width: 100%;
  height: 100%;
}

.line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: networkFlow 8s infinite linear;
}

.line-1 {
  top: 15%;
  left: -50%;
  width: 200%;
  height: 1px;
  animation-delay: 0s;
}

.line-2 {
  top: 35%;
  left: -50%;
  width: 200%;
  height: 1px;
  animation-delay: 2s;
}

.line-3 {
  top: 55%;
  left: -50%;
  width: 200%;
  height: 1px;
  animation-delay: 4s;
}

.line-4 {
  top: 75%;
  left: -50%;
  width: 200%;
  height: 1px;
  animation-delay: 6s;
}

.line-5 {
  top: 85%;
  left: -50%;
  width: 200%;
  height: 1px;
  animation-delay: 1s;
}

@keyframes networkFlow {
  0% { transform: translateX(-100%); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* 浮动教育图标 */
.floating-icons {
  position: absolute;
  width: 100%;
  height: 100%;
}

.icon {
  position: absolute;
  font-size: 24px;
  opacity: 0.6;
  animation: floatUpDown 6s infinite ease-in-out;
}

.icon-1 { top: 20%; left: 10%; animation-delay: 0s; }
.icon-2 { top: 30%; right: 15%; animation-delay: 1s; }
.icon-3 { top: 60%; left: 5%; animation-delay: 2s; }
.icon-4 { top: 70%; right: 20%; animation-delay: 3s; }
.icon-5 { top: 40%; left: 8%; animation-delay: 4s; }
.icon-6 { top: 80%; right: 10%; animation-delay: 5s; }

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

/* 几何图案 */
.geometric-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: rotateShape 20s infinite linear;
}

.shape-1 {
  top: 10%;
  right: 20%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  animation-delay: 0s;
}

.shape-2 {
  bottom: 20%;
  left: 15%;
  width: 80px;
  height: 80px;
  transform: rotate(45deg);
  animation-delay: 5s;
}

.shape-3 {
  top: 50%;
  right: 10%;
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 50px solid rgba(255, 255, 255, 0.05);
  animation-delay: 10s;
}

@keyframes rotateShape {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 主容器 */
.main-container {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

/* 左侧品牌区域 */
.brand-section {
  flex: 1;
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-content {
  max-width: 500px;
  color: white;
}

.brand-logo {
  display: flex;
  align-items: center;
  margin-bottom: 60px;
}

.logo-icon {
  width: 100px;
  height: 100px;
  margin-right: 30px;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

.logo-text h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #ffffff, #e3f2fd);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-text p {
  font-size: 18px;
  margin: 10px 0 0 0;
  opacity: 0.9;
  font-weight: 300;
  letter-spacing: 1px;
}

.brand-features {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.feature-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(10px);
}

.feature-icon {
  font-size: 36px;
  margin-right: 20px;
  width: 60px;
  text-align: center;
}

.feature-text h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.feature-text p {
  font-size: 14px;
  margin: 0;
  opacity: 0.8;
  line-height: 1.5;
}

/* 右侧注册区域 */
.register-section {
  flex: 1;
  padding: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.register-card-wrapper {
  width: 100%;
  max-width: 650px;
}

.register-card-header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.register-card-header h2 {
  font-size: 36px;
  font-weight: 600;
  margin: 0 0 15px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.register-card-header p {
  font-size: 16px;
  opacity: 0.9;
  margin: 0;
  font-weight: 300;
}

/* 注册卡片 */
.register-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 65px 50px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  height: 600px; /* 固定高度，与登录页面一致 */
  display: flex;
  flex-direction: column;
}

/* 表单样式 */
.register-form {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 滚动容器 */
.form-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  margin-right: -10px;
}

/* 自定义滚动条样式 */
.form-scroll-container::-webkit-scrollbar {
  width: 6px;
}

.form-scroll-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.form-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
  transition: background 0.3s ease;
}

.form-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* 表单底部固定区域 */
.form-footer {
  padding-top: 25px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 25px;
  flex-shrink: 0;
}

.input-group {
  margin-bottom: 25px;
}

.input-group:last-child {
  margin-bottom: 15px;
}

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.sms-input-group {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.sms-input {
  flex: 1;
}

.sms-btn {
  white-space: nowrap;
  min-width: 130px;
  height: 56px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s ease !important;
}

.sms-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e9ecef, #dee2e6) !important;
  border-color: #ced4da !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
}

/* 输入框样式覆盖 */
:deep(.business-input .el-input__wrapper) {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: none;
  padding: 18px 20px;
  background: #ffffff;
  transition: all 0.3s ease;
  height: 56px;
}

:deep(.business-input .el-input__wrapper:hover) {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.05);
}

:deep(.business-input .el-input__wrapper.is-focus) {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

:deep(.business-input .el-input__inner) {
  color: #1f2937;
  font-size: 15px;
  font-weight: 400;
}

:deep(.business-input .el-input__inner::placeholder) {
  color: #9ca3af;
}

:deep(.business-input .el-input__prefix) {
  color: #6b7280;
}

/* 注册按钮样式 */
.business-register-btn {
  width: 100%;
  height: 60px;
  font-size: 17px;
  font-weight: 600;
  margin: 25px 0 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.business-register-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.btn-arrow {
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s ease;
}

.business-register-btn:hover .btn-arrow {
  transform: translateX(5px);
}

/* 辅助链接样式 */
.helper-links {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 15px;
}

:deep(.helper-link) {
  font-size: 14px;
  color: #6b7280 !important;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

:deep(.helper-link:hover) {
  color: #3b82f6 !important;
}



/* 对话框样式增强 */
:deep(.business-dialog .el-dialog) {
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

:deep(.business-dialog .el-dialog__header) {
  padding: 30px 30px 20px;
  border-bottom: 1px solid #f1f5f9;
}

:deep(.business-dialog .el-dialog__title) {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

:deep(.business-dialog .el-dialog__body) {
  padding: 30px;
}

.verify-code-input {
  display: flex;
  gap: 15px;
  align-items: center;
}

.verify-btn {
  white-space: nowrap;
  min-width: 140px;
  height: 48px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
  transition: all 0.3s ease !important;
}

.verify-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e9ecef, #dee2e6) !important;
  border-color: #ced4da !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding-top: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .main-container {
    flex-direction: column;
  }
  
  .brand-section {
    padding: 40px 20px;
  }
  
  .register-section {
    padding: 20px;
  }
  
  .brand-logo {
    flex-direction: column;
    text-align: center;
  }
  
  .logo-icon {
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  .feature-item {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .brand-section {
    padding: 30px 15px;
  }
  
  .register-section {
    padding: 15px;
  }
  
  .register-card {
    padding: 30px 25px;
    height: 500px; /* 在移动设备上减少高度 */
  }
  
  .register-card-header h2 {
    font-size: 28px;
  }
  
  .logo-text h1 {
    font-size: 36px;
  }
  
  .sms-input-group {
    flex-direction: column;
    gap: 15px;
  }
  
  .sms-btn {
    width: 100%;
  }
  
  .helper-links {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .input-group {
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .register-card {
    padding: 25px 20px;
    height: 450px; /* 在超小屏幕上进一步减少高度 */
  }
  
  .business-register-btn {
    height: 50px;
    font-size: 15px;
  }
  
  .input-group {
    margin-bottom: 18px;
  }
}
</style>
